package part4.client;

import part4.interpreter.Interpreter;
import part4.interpreter.Lexer;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        while (true){
            System.out.print("calc> ");
            String text = scanner.nextLine();
            if (text.equals("exit"))
                break;
            Lexer lexer = new Lexer(text);
            Interpreter interpreter = new Interpreter(lexer);
            int res = interpreter.expr();
            System.out.println("res: "+res);
        }
    }
}
